using MbUnit.Framework;
using Rhino.Mocks;

namespace Blog.Testing
{
  [TestFixture]
  public abstract class SpecificationContext<SystemUnderTestType>
  {
    protected SystemUnderTestType sut;

    [SetUp]
    public void Setup()
    {
      sut = EstablishContext();
      BecauseOf();
    }

    [TearDown]
    public virtual void Cleanup(){}

    protected abstract SystemUnderTestType EstablishContext();
    
    protected abstract void BecauseOf();
    
    protected TypeToStub Stub<TypeToStub>()
    {
      return MockRepository.GenerateStub<TypeToStub>();
    }
    
    protected TypeToMock Mock<TypeToMock>()
    {
      return MockRepository.GenerateMock<TypeToMock>();
    }

  }
}